package com.ssm.service.impl;


import com.ssm.dao.IUserDao;
import com.ssm.model.User;
import com.ssm.service.IUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;

@Service("userService")
public class UserServiceImpl implements IUserService {

    @Resource
    private IUserDao userDao;

    @Override
    public ArrayList<User> selectAll() {
        return this.userDao.selectAll();
    }

    public User selectUser(int id){
        return this.userDao.selectDao(id);
    }

    @Override
    public int insert(User user){
        return 0;
    }

    @Override
    public Boolean addUser(User user){
        return this.userDao.addDao(user);
    }

    @Override
    public Boolean delUser(int id){
        return this.userDao.delDao(id);
    }

    @Override
    public Boolean updateUser(User user){
        return this.userDao.updateDao(user);
    }

}
